package com.hdsx.springboot;

import com.hdsx.springboot.bean.BaseNodeBean;
import com.hdsx.springboot.bean.User;
import com.hdsx.springboot.server.UserServer;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.ApplicationContext;
import org.springframework.core.io.UrlResource;
import org.springframework.scheduling.annotation.EnableScheduling;

import java.net.URL;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.ServiceLoader;

/**
 * @author 占贤银
 * time 2024/5/18 15:40
 * description 生命之灯因热情而点燃，生命之舟因拼搏而前行
 */

@SpringBootApplication
// @MapperScan("") // 扫描mybatis中的代理类
@ServletComponentScan(basePackages = "com.hdsx.springboot.servlet")
// 扫描servlet Filter listener
public class SpringbootAppllication {

    public static void main(String[] args) {
//        try {
//            ServiceLoader.load(UserServer.class);
//            final Enumeration<URL> resources = Thread.currentThread().getContextClassLoader().
//                    getResources("META-INF/spring.factories");
//            while (resources.hasMoreElements()) {
//                final URL url = resources.nextElement();
//                System.out.println(url.getPath());
//            }
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
         ApplicationContext ac = SpringApplication.run(SpringbootAppllication.class, args);
//        ServiceLoader<UserServer> userServers = ServiceLoader.load(UserServer.class);
//        Iterator<UserServer> iterator = userServers.iterator();
//        while (iterator.hasNext()) {
//            iterator.next().say();
//        }
    }
}
